/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Xadrez.Modelo;

/**
 *
 * @author Jéssica
 */
public class Square {

    private int positionX;
    private int positionY;

    private Piece piece;

    public Square(){

    }

    public Square(int x, int y){

        this.setPiece(null);
        this.setPositionX(x);
        this.setPositionY(y);

    }


    public int getPositionX(){
        return this.positionX;
    }

    public int getPositionY(){
        return this.positionY;
    }

    public Piece getPiece(){
        return this.piece;
    }




    public void setPositionX(int x){
        this.positionX = x;
    }

    public void setPositionY(int y){
        this.positionY = y;
    }

    public void setPiece(Piece p){
        this.piece = p;
    }

    public boolean isValidSquare(){
        boolean valid = false;

        if((this.getPositionX()>7)||
                (this.getPositionX()<0)||
                (this.getPositionY()>7)||
                (this.getPositionY()<0)){
            valid = false;
        } else valid = true;


        return valid;
    }

}
